//-------------------------------------------------------------------
//  Top.h
//-------------------------------------------------------------------
#define NUMBITS		256
//-------------------------------------------------------------------
#define WORDSIZE	(sizeof(int)*8)    //32
#define	HALFSIZE	(WORDSIZE/2)       //16
//-------------------------------------------------------------------
#define	NUMWORD		(NUMBITS/WORDSIZE)
//-------------------------------------------------------------------
#define	HIMASK		(-1L<<HALFSIZE)    //0x ffff 0000
#define LOMASK		(~HIMASK)          //0x 0000 ffff
#define CARRY		(1L<<HALFSIZE)     //0x 0001 0000
#define MSB_HW		(CARRY>>1)         //0x 0000 8000
#define UPRSHIFT	(NUMBITS%WORDSIZE)
//-------------------------------------------------------------------
#define MAXLONG		(NUMWORD+1)
#define MAXBITS		(MAXLONG*WORDSIZE)//in order to multiply
#define MAXSHIFT	(WORDSIZE-1)       //31
#define MSB			(1L<<MAXSHIFT)     //0x 8000 0000
#define MAXSTRING	(MAXLONG*WORDSIZE/3)
//-------------------------------------------------------------------
#define UPRBIT		(1L<<(UPRSHIFT-1))
#define UPRMASK		(~(-1L<<UPRSHIFT))
//-------------------------------------------------------------------
//  Loop for Field2n
//-------------------------------------------------------------------
#define SUMLOOP(i)	for(i =      0; i < MAXLONG; i++)
//-------------------------------------------------------------------
//  Loop for Bigint
//-------------------------------------------------------------------
#define	INTMAX		(4*MAXLONG-1)
#define	INTLOOP(i)	for(i = INTMAX; i >= 0     ; i--)
//-------------------------------------------------------------------
typedef	short int INDEX;
//-------------------------------------------------------------------
typedef unsigned long ELEMENT;
//-------------------------------------------------------------------
typedef struct {
	ELEMENT 	e[MAXLONG];
}  FIELD2N;
//-------------------------------------------------------------------
typedef struct {
	ELEMENT		hw[4*MAXLONG];
}  BIGINT;
//-------------------------------------------------------------------